class singleton()
{
private:
    static singleton m_instance;
    singleton(){}
    ~singleton(){}
    singleton(const singleton& instance)=delete;
    const singleton& operator=(const singleton& instance)=delete;
public:
    static singleton* GetInstance()
    {
        return &m_instance;
    }
}

singleton singleton::m_instance;


class singleton_lazy()
{
private:
    static singleton_lazy* m_instance;
    static std::mutex m_mt;
    singleton_lazy(){}
    ~singleton_lazy(){}
    singleton_lazy(const singleton_lazy& instance)=delete;
    const singleton_lazy& operator=(const singleton_lazy& instance)=delete;
public:
    static singleton_lazy* GetInstance()
    {
        if(m_instance==nullptr)
        {
            m_mt.lock();
            if(m_instance==nullptr)
            {
                m_instance=new singleton_lazy();
                return m_instance;
            }
            m_mt.unlock();
        }
    }

    class CGarbo()
    {
        ~CGarbo()
        {
            if(singleton_lazy::m_instance)
            {
                delete singleton_lazy::m_instance;
            }
        }
    }

    static CGarbo cg;
}